#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File ：FavoriteLogic.py
@Author ：zqy
@Email : zqingy@work@163.com 
@note: 
"""
from flask import g

from application.logic import BaseLogic
from application.model.UserModel import Favorite


class FavoriteLogic(BaseLogic):
    model: Favorite = Favorite

    @classmethod
    def get_list(cls):
        return [i.to_dict() for i in cls.model.query(user_id=g.user.id).all()]
